The present invention relates to an image processing method and apparatus and, more particularly, to an image processing method which identifies edges in an input image and performs smoothing correction on the edges to obtain a high quality image, and which allows the smoothing correction to be done fast and efficiently using an apparatus constructed with simple circuits. The invention also relates to an apparatus capable of employing the method.
Office automation devices, such as personal computers and word processors, have been widely used, and accordingly, there have been developed countless recording methods for printing apparatus to print out information inputted from those office automation devices. Among the recording methods, a dot matrix method, such as the wire dot method, heat transfer method, or ink jet method, is one of the most popular recording methods, since a printer using that method can be constructed at low price and compact size.
However, the dot matrix method to be applied to a printing apparatus forming an image requires dots to form the image, and thus, notches on the outline of an image, especially on slopes of the image, caused by the dot arrangement are problems which may decrease quality of the image. In order to overcome the problem, there exists a smoothing correction method, which identifies notches of an original image by following a predetermined rule, and adds dots to edges where the notches are found in the original image. This process is disclosed in Japanese Patent Publication No. 54-23769, Japanese Patent Publication No. 57-2105, and Japanese Patent Publication No. 60-236362, and will be referred to as "original smoothing correction" hereinafter.
Another method to overcome the problem comprises a process of finding notches in an original image by following a predetermined rule, adding dots on one side of a line where the notches are located, with respect to a scanning direction (e.g., on an outline where non-print dots are converted into print pixels), and eliminating dots on the other side (e.g., on an outline where print dots are converted into non-print dots).
This process is disclosed in Japanese Patent Publication No. 63-48226, and will be referred to as "advanced smoothing correction" hereinafter.
However, in an original smoothing correction which adds dots, lines of images become thick because of the gain of dots. This problem is explained below with reference to FIG. 35.
(1) in FIG. 35 is an original image, and (2) in FIG. 35 is an image resulting from original smoothing correction being applied to the original image. As shown in (2) in FIG. 35, compared to (1) in FIG. 35, notches of the image are smoothed since dots are added at edges. On the other hand, since sixteen dots are added to the image (1) in FIG. 35, the line of the image (2) in FIG. 35 is thicker than in the original image. In order not to thicken lines of an image after smoothing correction is applied, it is necessary to reduce the number of dots to be added in edges between dots, which however prevents the original image from being smoothed. Thus, in original smoothing correction, thickening the lines or reducing the number of dots to be added, is chosen, each however occurring at the expense of the other.
Further, in the above-mentioned advanced smoothing correction according to which dots are added on one side of a line with respect to the scanning direction and eliminated on the other side, the aforesaid problem of thickened lines is improved; however, the shapes of some types of images may become imbalanced.
Generally, an image which requires the smoothing correction contains a slope or slopes in it. Types of slopes in the image can be basically divided into two kinds, namely, a right-rising-slope and a right-falling-slope. In the original image shown in (1) in FIG. 35, parts which require smoothing correction are right-rising-slopes [a] and [d], and right-falling-slopes [b] and [c]. In a case where the advanced smoothing correction is applied to the original image, the advanced smoothing correction applied to the slopes [a] and [d] is the same, and so is the advanced smoothing correction applied to the slopes [b] and [c]. In other words, in the right-rising-slopes [a] and [d] and in the right-falling-slopes [b] and [c], "thickening" correction is performed on the side where the border of the slope changes from white to black, whereas the "thinning" correction is performed on the side where the border of the slope changes from black to white. As a result, slopes [a] and [c] are thickened outside and thinned inside, while on the other hand, slopes [b] and [d] are thinned outside and thickened inside, which is not a desirable smoothing correction.
It is theoretically possible to choose a best smoothing correction which would correct slope [a] and slope [d] differently by detecting that the slopes [a], [b], [c], and [d] are forming one "closed" image (i.e., forming a closed loop); however, this requires complicated processing. Thus, such smoothing correction cannot be adopted in a machine of reasonable price.
All notches in an image can be determined by employing a conventional pattern matching of an edge detecting method; however, this method also requires very complicated processing. Therefore, hardware having a very large capacity is required to adopt this method, and thus the method is only used by costly apparatus.
Conventional smoothing correction method will now be described with reference to the figures.
Notches in a binarized image appear at edges on outlines, namely at right-angled-corner constructed with printing dots. Patterns of a (1.times.1) pixel edge to a (3.times.3) pixel edge are shown in FIG. 37 as examples. In FIG. 37, (1) is a pattern having a (3.times.3) edge; (2), a (2.times.3) edge; (3), a (1.times.3) edge; (4), a (3.times.2) edge; (5), a (2.times.2) edge; (6), a (1.times.2) edge; (7), a (3.times.1) edge; (8), a (2.times.1) edge; and (9), a (1.times.1) edge.
In order to correct an original image by determining (identifying) edges of up to (3.times.3) size as in the above description and reduce the notches at each edge, the nine patterns shown in FIG. 37 and additional patterns obtained by rotating the nine patterns by 90 degrees, by 180 degrees, and 270 degrees, which added up to a total of thirty-six patterns (nine patterns * 4), have to be compared with the original image.
If recording resolution of a printing apparatus is 360 DPI (dots/inch), then the number of dots which would fill a record medium of A4 size is over 10,000,000 pixels. To compare images, all the matching patterns have to be compared to all the pixels in the record area of the record medium, shifting pixel by pixel in both horizontal and vertical directions. Therefore, the comparing operation has to be repeated more than 360 million times to print on the A4 sized printing medium.
Further, as edges as small as 1 mm are desired to be smoothed by using the aforesaid apparatus of 360 DPI resolution, to correct the above nine edge sizes is not enough, but edges up to (14.times.14) have to be determined. For determining the (1.times.1) edges to the (14.times.14) edges, the number of matching pattern required is seven-hundred and eighty-four (784), whereas thirty-six (36) patterns are required for correcting up to (3.times.3) edges. Thus, if the pattern size of the matching pattern increases in order to reduce the notches of an image to produce a high quality image, the capacity required to perform the process increases enormously.
In addition, a user looks for a printing apparatus which performs high speed and high quality printing, and also is low in price. Therefore, a smoothing correction method which can be employed by such low priced apparatus is strongly desired.